//
//  RoomModel.m
//  OfficeBook
//
//  Created by 孙晓奇 on 15/10/30.
//  Copyright © 2015年 sunny. All rights reserved.
//

#import "RoomModel.h"

@implementation RoomModel
/* 
 roomDict
 
 "id": 3,
 "name": "MaryKay",
 "capacity": 8,
 "floor": 3,
 "state": 1
 */

-(instancetype)initWithDictionary:(NSDictionary *)roomDict{
    self = [super init];
    if (self) {
        self.id = [roomDict[@"id"] intValue];
        self.name = roomDict[@"name"];
        self.capacity = [roomDict[@"capacity"] intValue];
        self.floor = [roomDict[@"floor"] intValue];
        self.state = [roomDict[@"state"] intValue];
    }
    return self;
}

-(id)copyWithZone:(NSZone *)zone{
    RoomModel *copy = [[[self class] allocWithZone:zone] init];
    copy->_id = self->_id;
    copy->_name  = self->_name;
    copy->_capacity = self->_capacity;
    copy->_floor = self->_floor;
    copy->_state = self->_state;
    return copy;
}

@end
